package 命令模式;

public class BeatsOffCommand implements Command{
    BeatsReceiver beatsReceiver;
    BeatsOffCommand(BeatsReceiver beatsReceiver){
        this.beatsReceiver=beatsReceiver;
    }
    @Override
    public void execute() {
        beatsReceiver.off();
    }

    @Override
    public void undo() {
        beatsReceiver.on();
    }
}
